﻿{include file="public/header" /}
<title></title>
</head>

<body>
	<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 系统管理 <span class="c-gray en">&gt;</span> 会员管理
		<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
	</nav>
	<form class="form form-horizontal" id="form-admin-add" method="post" style="width: 45%;">
		<div class="row cl">
			<label class="form-label col-xs-4"><span class="c-red">*</span>会员手机号码：</label>
			<div class="formControls col-xs-8 ">
				<input id="mobile" name="mobile" type="text" class="input-text" placeholder="请输入会员手机号码" >
			</div>
		</div>
		<div class="row cl">
			<button type="submit" style="float: right;margin-top: 10px;width: 270px;height: 25px;">搜索</button>
		</div>
	</form>
	<div class="page-container">
	<table class="table table-border table-bordered table-bg">
		<thead>
			<tr class="text-c">
				<th width="40">会员编号</th>
				<th>用户名</th>
				<th>oem</th>
				<th>省代</th>
				<th>市代</th>
				<th>余额</th>
				<th>佣金</th>
				<th>鼓励金</th>
				<th>商家</th>
				<th>推荐人</th>
				<th width="130">状态</th>
				<th width="130">增加时间</th>
				<th width="100">操作</th>
			</tr>
		</thead>
		<tbody>
			{volist name="list" id="vo" empty="这里没有数据"}
			<tr class="text-c">
				<td>{$vo.id}</td>
				<td>{$vo.mobile?$vo.mobile:'扫码会员'}</td>
				<td>{$vo.dname}</td>
				<td>{$vo.cname}</td>
				<td>{$vo.pname}</td>
				<td><a href="{:url('accounts/userye',['user_id'=>$vo.id])}">{$vo.balance}</a></td>
				<td><a href="{:url('accounts/useryj',['user_id'=>$vo.id])}"><?php echo substr($vo['commission'],0,strlen($vo['commission'])-2)?></a></td>
				<td><a href="{:url('accounts/userglj',['user_id'=>$vo.id])}">{$vo.score}</a></td>
				<td>{$vo.agent_name}</td>
				<td>{$vo.tmobile}</td>
				<td>
					{if $vo.status==1}
					正常
					{else /}
					冻结 
					{/if}			
				</td>
				<td>{$vo.add_time}</td>
				<td class="td-manage">
					<a title="删除" href="javascript:;" onclick="complain_del(this,{$vo.id},{$vo.status})" class="ml-5" style="text-decoration:none">
					{if $vo.status==1}
					<span style="color: red;">冻结</span>
					{else /}
					<span style="color: green;">激活</span>
					{/if}
					</a>
				</td>
			</tr>
			{/volist}
			</tbody>
			</table>
			<style>
			.pagination li{float: left;}
			</style>
			<div id="pageNav" class="pageNav">{$list->render()}</div>
		</div>
		
		{include file="public/footer" /}
		<script type="text/javascript">
			/*管理员-删除*/
			function complain_del(obj, id, status) {
				var tiele = '';
				if(status==1){
					tiele = '确认要冻结吗？';
				}else{
					tiele = '确认要激活吗？';
				}
				layer.confirm(tiele, {
					btn: ['确定', '取消'] //按钮
				}, function() {
					$.ajax({
						type: 'get',
						url: "{:url('accounts/user_frozen')}",
						dataType: 'json',
						data: {
							id: id,
							status: status
						},
						success: function(data) {
							if(data.code == 200) {
								layer.msg(data.msg, {
								  icon: 1,
								  time: 1000 //2秒关闭（如果不配置，默认是3秒）
								}, function(){
									location.href = "{:url('accounts/user_list')}";
								});
							} else {
								layer.msg(data.msg, {
									icon: 1,
									time: 1000
								});
							}
						},
						error: function(data) {
							console.log(data.msg);
						}
					});
				});
			}

		</script>